package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.DevicePageQueryDto;
import com.zzyl.entity.Device;
import com.zzyl.vo.DeviceVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface DeviceMapper {

    @Select("select count(1) from device where device_name = #{deviceName}")
    Long countByDeviceName(String deviceName);

    void insertSelective(Device device);

    Page<DeviceVo> selectByPage(DevicePageQueryDto devicePageQueryDto);

    DeviceVo selectByIotId(String iotId);

    void updateDevice(Device device);

    void deleteDevice(Device device);
}
